package com.ssm.lzh.serachId;

import com.ssm.mapper.NumberMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class SerachId {

    @Resource
    private NumberMapper numberMapper;

    public String ccid(String i){
        System.out.println("==================="+i);
        String s = this.numberMapper.queryId(i);
        System.out.println(s);
        String o="";
        if(s==null){
            o=i+"001";
        }else{
            int i1 = Integer.parseInt(s);
             o= i+String.format("%03d",i1+1);
        }
        System.out.println("--------------"+o);
        this.numberMapper.addid(o);
        return o;
    }

}
